(function($){
	$.fn.countByDayInit = function(){
		var $this = $(this);
		
		//门店下拉框
		$('#shop',$this).combobox({
			data:TEA.getShopList(),
			valueField:'dataDictionaryID',
			textField:'dataDictionaryName',
			width:150
		})
		//查询
		$('#search',$this).click(function(){
			var queryContent = $('.queryContent',$this);
			var shopID =$('#shop',$this).combobox('getValue');
			var beginDate = $('#beginDate',queryContent).val();
			
			var content = {shopID:shopID,beginDate:beginDate};
			$('#countList',$this).datagrid({
				queryParams:content,
				pageNumber:1
			});
		})
		//重置
		$('#reset',$this).click(function(){
			var queryContent = $('.queryContent',$this);
			$('#shop',$this).combobox('clear');
			$('#beginDate',queryContent).val('');
		})
		//加载查询页面列表
		$('#countList',$this).datagrid({
			singleSelect:true,
			url:'statistics!countByDay.action',
			fit:true,
			method:"POST",
			nowrap:true,
			striped: true,
			collapsible:true,
			rownumbers:true,
			pagination:true,
			pageSize:30,
			showFooter:true,
			columns:[[
				{field:'name',title:'项目',width:100,align:"center"},
				{field:'value',title:'费用',width:200,align:"center"}
			]]
		});
	}
})(jQuery);